#include <iostream>
#include <fstream>
#include <string>
#include <conio.h>
#include <ctype.h>
#include "Book.h"
using namespace std;



void readFile(char * nameFile)
{
	Book * book = new Book[100];
	DateOfPub * date = new DateOfPub[100];
	//Book  book;
	//DateOfPub date;
	//char * line = new char[];
	char * ptrCut;
	string line("");
	ifstream  myFile;
	char * maIsbn = new char[];
	char * author = new char[];
	char * nameBook = new char[];
	int  cDay;
	int  cMonth;
	int  cYear;
	int Quantily = 0;
	int soDong = 0;
	int count = 0;
	myFile.open(nameFile);
	
	/*getline(myFile,line,'\t');
	cout<<line<<endl;*/

	while (!myFile.eof())
	{
		getline(myFile,line);
		ptrCut = strtok ((char*)line.c_str(),"\t");
		while (ptrCut != NULL)
		{
			count++;
			if (count == 1)
			{
				maIsbn = ptrCut;
				book[soDong].setIsbn(maIsbn);
			}
			if (count == 2)
			{
				author = ptrCut;
				book[soDong].setAuthor(author);
			}
			if (count == 3)
			{
				nameBook = ptrCut;
				book[soDong].setName(nameBook);
			}
			if (count == 4)
			{
				cDay = atoi(ptrCut);
				date[soDong].setDay(cDay);
			}
			if (count == 5)
			{
				cMonth = atoi(ptrCut);
				date[soDong].setMonth(cMonth);
			}
			if (count == 6)
			{
				cYear = atoi(ptrCut);
				date[soDong].setYear(cYear);
			}

			if (count == 7)
			{
				Quantily = atoi(ptrCut);
				book[soDong].setNumber(Quantily);
			}

			ptrCut = strtok (NULL, "\t/");
			if (ptrCut == NULL)
			{
				count = 0;
			}
		}
		soDong++;
	}



	for (int a = 0; a < soDong; a++)
	{
		book[a].PrintfBook();
		date[a].PrinfDateOfPub();
		cout<<"\n\n";
	}
	delete []book;
	delete []date;
	myFile.close();
}




int main()
{
	//012345678910
	//xxx-xxx-xxx
	//readFile("BookList.txt");

	string strTest;
	getline(cin,strTest);
	cout<<strTest<<endl;
	int doDai = strTest.length();
	//cout<<"dodai: "<<doDai<<endl;
	//int i = 0;
	if (strTest[3] == '-' && strTest[7] == '-' && doDai == 11)
	{
        cout<<"dung :"<<strTest<<endl;
        break;
	}
	else
	{
        cout<<"moi ban nhap lai "<<strTest<<endl;
        break;
	}


	
	

	system("pause");
}